package glz.hawk.bookstore.mapper;

import glz.hawk.bookstore.model.Book;
import glz.hawk.bookstore.model.BookExample;
import glz.hawk.bookstore.model.BookWithBLOBs;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BookMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @SelectProvider(type=BookSqlProvider.class, method="countByExample")
    long countByExample(BookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @DeleteProvider(type=BookSqlProvider.class, method="deleteByExample")
    int deleteByExample(BookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @Delete({
        "delete from book",
        "where BOOK_ID = #{bookId,jdbcType=DECIMAL}"
    })
    int deleteByPrimaryKey(BigDecimal bookId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @Insert({
        "insert into book (BOOK_ID, ISBN, ",
        "BOOK_NAME, BOOK_TYPE, ",
        "BOOK_PRICE, PUBLISH_DATE, ",
        "TIME_SPEC, CREATE_DATE, ",
        "CREATE_USER, BOOK_DESCRIPTION, ",
        "BOOK_PICTURE)",
        "values (#{bookId,jdbcType=DECIMAL}, #{isbn,jdbcType=VARCHAR}, ",
        "#{bookName,jdbcType=VARCHAR}, #{bookType,jdbcType=VARCHAR}, ",
        "#{bookPrice,jdbcType=DECIMAL}, #{publishDate,jdbcType=DATE}, ",
        "#{timeSpec,jdbcType=TIME}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{createUser,jdbcType=CHAR}, #{bookDescription,jdbcType=LONGVARCHAR}, ",
        "#{bookPicture,jdbcType=LONGVARBINARY})"
    })
    int insert(BookWithBLOBs row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @InsertProvider(type=BookSqlProvider.class, method="insertSelective")
    int insertSelective(BookWithBLOBs row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @SelectProvider(type=BookSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="BOOK_ID", property="bookId", jdbcType=JdbcType.DECIMAL, id=true),
        @Result(column="ISBN", property="isbn", jdbcType=JdbcType.VARCHAR),
        @Result(column="BOOK_NAME", property="bookName", jdbcType=JdbcType.VARCHAR),
        @Result(column="BOOK_TYPE", property="bookType", jdbcType=JdbcType.VARCHAR),
        @Result(column="BOOK_PRICE", property="bookPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="PUBLISH_DATE", property="publishDate", jdbcType=JdbcType.DATE),
        @Result(column="TIME_SPEC", property="timeSpec", jdbcType=JdbcType.TIME),
        @Result(column="CREATE_DATE", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATE_USER", property="createUser", jdbcType=JdbcType.CHAR),
        @Result(column="BOOK_DESCRIPTION", property="bookDescription", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="BOOK_PICTURE", property="bookPicture", jdbcType=JdbcType.LONGVARBINARY)
    })
    List<BookWithBLOBs> selectByExampleWithBLOBs(BookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @SelectProvider(type=BookSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="BOOK_ID", property="bookId", jdbcType=JdbcType.DECIMAL, id=true),
        @Result(column="ISBN", property="isbn", jdbcType=JdbcType.VARCHAR),
        @Result(column="BOOK_NAME", property="bookName", jdbcType=JdbcType.VARCHAR),
        @Result(column="BOOK_TYPE", property="bookType", jdbcType=JdbcType.VARCHAR),
        @Result(column="BOOK_PRICE", property="bookPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="PUBLISH_DATE", property="publishDate", jdbcType=JdbcType.DATE),
        @Result(column="TIME_SPEC", property="timeSpec", jdbcType=JdbcType.TIME),
        @Result(column="CREATE_DATE", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATE_USER", property="createUser", jdbcType=JdbcType.CHAR)
    })
    List<Book> selectByExample(BookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @Select({
        "select",
        "BOOK_ID, ISBN, BOOK_NAME, BOOK_TYPE, BOOK_PRICE, PUBLISH_DATE, TIME_SPEC, CREATE_DATE, ",
        "CREATE_USER, BOOK_DESCRIPTION, BOOK_PICTURE",
        "from book",
        "where BOOK_ID = #{bookId,jdbcType=DECIMAL}"
    })
    @Results({
        @Result(column="BOOK_ID", property="bookId", jdbcType=JdbcType.DECIMAL, id=true),
        @Result(column="ISBN", property="isbn", jdbcType=JdbcType.VARCHAR),
        @Result(column="BOOK_NAME", property="bookName", jdbcType=JdbcType.VARCHAR),
        @Result(column="BOOK_TYPE", property="bookType", jdbcType=JdbcType.VARCHAR),
        @Result(column="BOOK_PRICE", property="bookPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="PUBLISH_DATE", property="publishDate", jdbcType=JdbcType.DATE),
        @Result(column="TIME_SPEC", property="timeSpec", jdbcType=JdbcType.TIME),
        @Result(column="CREATE_DATE", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATE_USER", property="createUser", jdbcType=JdbcType.CHAR),
        @Result(column="BOOK_DESCRIPTION", property="bookDescription", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="BOOK_PICTURE", property="bookPicture", jdbcType=JdbcType.LONGVARBINARY)
    })
    BookWithBLOBs selectByPrimaryKey(BigDecimal bookId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @UpdateProvider(type=BookSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") BookWithBLOBs row, @Param("example") BookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @UpdateProvider(type=BookSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("row") BookWithBLOBs row, @Param("example") BookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @UpdateProvider(type=BookSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") Book row, @Param("example") BookExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @UpdateProvider(type=BookSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BookWithBLOBs row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @Update({
        "update book",
        "set ISBN = #{isbn,jdbcType=VARCHAR},",
          "BOOK_NAME = #{bookName,jdbcType=VARCHAR},",
          "BOOK_TYPE = #{bookType,jdbcType=VARCHAR},",
          "BOOK_PRICE = #{bookPrice,jdbcType=DECIMAL},",
          "PUBLISH_DATE = #{publishDate,jdbcType=DATE},",
          "TIME_SPEC = #{timeSpec,jdbcType=TIME},",
          "CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},",
          "CREATE_USER = #{createUser,jdbcType=CHAR},",
          "BOOK_DESCRIPTION = #{bookDescription,jdbcType=LONGVARCHAR},",
          "BOOK_PICTURE = #{bookPicture,jdbcType=LONGVARBINARY}",
        "where BOOK_ID = #{bookId,jdbcType=DECIMAL}"
    })
    int updateByPrimaryKeyWithBLOBs(BookWithBLOBs row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table book
     *
     * @mbg.generated Wed Aug 20 09:54:23 CST 2025
     */
    @Update({
        "update book",
        "set ISBN = #{isbn,jdbcType=VARCHAR},",
          "BOOK_NAME = #{bookName,jdbcType=VARCHAR},",
          "BOOK_TYPE = #{bookType,jdbcType=VARCHAR},",
          "BOOK_PRICE = #{bookPrice,jdbcType=DECIMAL},",
          "PUBLISH_DATE = #{publishDate,jdbcType=DATE},",
          "TIME_SPEC = #{timeSpec,jdbcType=TIME},",
          "CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},",
          "CREATE_USER = #{createUser,jdbcType=CHAR}",
        "where BOOK_ID = #{bookId,jdbcType=DECIMAL}"
    })
    int updateByPrimaryKey(Book row);
}